<!DOCTYPE html>
<html>
<head>
    <title>用户账单</title>
    <style type="text/css">
        table{border-collapse:collapse;border-spacing:0;border-left:1px solid #888;border-top:1px solid #888;}
        th,td{border-right:1px solid #888;border-bottom:1px solid #888;padding:5px 15px;}
        th{font-weight:bold;background:#ccc;}
    </style>
</head>
<body>
<div>
    <table align="center" width="98%" style="margin-top: 10px">
        <tbody id="content">
            <tr>
                <td>编号</td>
                <td>支出</td>
                <td>详情</td>
                <td>操作时间</td>
            </tr>
            <?php
                $time = date('Y-m',time());
                $time_s = strtotime($time);
            ?>


            <?php foreach($list as $k => $v):?>

            <?php if($v['update_time'] < $time_s): ?>
            <?php
                $time = date('Y-m',$v['update_time']);
                $time_s = strtotime($time);
            ?>
                <tr style="background:#ddd">
                    <td colspan="4" align="center"><?=date('Y年m月',$v['update_time'])?></td>
                </tr>
            <?php endif;?>
            <tr>
                <td><?=$v['id']?></td>
                <td style="color:<?=$v['charges'] > 0 ? 'green' : 'red'?>"><?=$v['charges'] > 0 ? '+' : ''?><?=$v['charges']?></td>
                <td><?=$v['remarks']?></td>
                <td><?=date('Y-m-d H:i:s',$v['update_time'])?></td>
            </tr>
            <?php endforeach;?>

            <?php if(!empty($page)):?>
            <tr>
                <td colspan="4" align="center"><?=$page?></td>
            </tr>
            <?php endif;?>
        </tbody>

    </table>
</div>
</body>
</html>